<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>编辑供应商</title>
        <script type="text/javascript" src="index.php?act=jslang"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
        <script language="javascript" type="text/javascript" src="{lib file=jquery.plugins/jquery.validate.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=DatePicker/WdatePicker.js}"></script>
        <script language="javascript" type="text/javascript" src="{lib file=ajaxfileupload.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/jquery.funkyUI.js}"></script>
        <script language="JavaScript" type="text/javascript" src="{res file=js/lan.js}"></script>
      
        <link href="template/style/css/style.css" type="text/css" rel="stylesheet" />

        <style>
            label.error {color:red;}
			input {
				vertical-align: -5px;_vertical-align: -1px;margin-right: 5px
			}
        </style>
        <script type="text/javascript">
$(function(){
	$('#merchant_form').validate({
    	onkeyup : false,
 		onfocusout : false,
		rules : {
			{if $user.role eq USER_ADMIN}
			fabric_shop_name: {
				required: true,
				byteRange : [ 3, 25, '{$charset}' ],
				remote : {
					url : 'index.php?app=member&act=check_user&ajax=1',
					type : 'get',
					data : {
						user_name : function() {
							return $('#fabric_shop_name').val();
						},
						uid : '{$user_id}'
					}
				}
			},
			{/if}
			type_id: {
				min: 1
			},
			address:{
				required: true
			},
			phone_tel:{
				required: true
			},
			phone_mob:{
				required: true
			},
			email : {
				email : true,
				remote : {
					url : 'index.php?app=member&act=check_email&ajax=1',
					type : 'get',
					data : {
						email : function() {
							return $('#email').val();
						},
						id : '{$user_id}'
					}
				}
			}
		},
		messages : {
			{if $user.role eq USER_ADMIN}
			fabric_shop_name: {
				required: '布行/档口不能为空',
				byteRange: '布行/档口名必须在3-15个字符之间',
				remote: '您提供的布行/档口已存在'
			},
			{/if}
			type_id: {
				min: '请选择布行/档口类型'
			},
			address:{
				required: '详细地址不能为空'
			},
			phone_tel:{
				required: '固定电话不能为空'
			},
			phone_mob:{
				required: '手机号码不能为空'
			},
			email : {
				email : '邮箱格式不正确',
				remote : '该邮箱已存在'
			}
		}
	});
});
</script>
    </head>
    <body>
        <div class="sub-body">
<div class="tab-frame" style="width:900px;">
    <div class="tab-title-1"><span>{$lang.edit_merch_info}</span></div>
    <form id="merchant_form" method="post">
        <table width="100%" cellspacing="0" cellpadding="0" align="left" class="tab-display">
            <tbody>
            	<tr>
                    <td width="15%" align="right">用户名:&nbsp;&nbsp;</td>
                    <td align="left">
                    	{if $user.role eq USER_ADMIN || $user.role eq USER_CIVILIAN}
                    	<input type="text" id="user_name" name="user_name" class="input-1" value="{$merch.user_name|escape}"/>
                    	{else}
                    	{$merch.user_name|escape}
						{/if}
                    </td>
                 </tr>
                 {if $user.role eq USER_ADMIN || $user.role eq USER_CIVILIAN}
                 <tr>
                    <td width="15%" align="right">布行/档口:&nbsp;&nbsp;</td>
                    <td align="left">
                    <input type="text" class="input-1" name="fabric_shop_name" id="fabric_shop_name" value="{$merch.fabric_shop_name|escape}" />
                    </td>
                 </tr>
                 {/if}
                 <tr>
                    <td align="right">登录密码:&nbsp;&nbsp;</td>
                    <td align="left">
                    <input type="password" class="input-1" name="password" id="password" value="" />
                    </td>
                 </tr>
                 <tr>
                    <td align="right">确认密码:&nbsp;&nbsp;</td>
                    <td align="left">
                    <input type="password" class="input-1" name="password2" id="password2" value="" />
                    </td>
                 </tr>
                 <tr>
						<td align="right">布行/档口类型:&nbsp;&nbsp;</td>
						<td align="left">
							<select name="type_id" id="type_id">
								<option value="0"></option>
								{html_options options=$fabric_types selected=$merch.type_id}
					        </select
						</td>
				</tr>
                 <tr>
						<td align="right">详细地址:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" style="width: 600px" name="address" id="address" value="{$merch.address|escape}" />
						</td>
					</tr>
					<tr>
						<td align="right">固定电话:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" class="input-1" name="phone_tel" id="phone_tel" value="{$merch.phone_tel|escape}" />
						</td>
					</tr>
					<tr>
						<td align="right">手机号码:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" class="input-1" name="phone_mob" id="phone_mob" value="{$merch.phone_mob|escape}" />
						</td>
					</tr>
					<tr>
						<td align="right">邮箱:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" class="input-1" name="email" id="email" value="{$merch.email|escape}" />
						</td>
					</tr>
					<tr>
						<td align="right">QQ:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" class="input-1" name="is_qq" id="is_qq" value="{$merch.is_qq|escape}" />
						</td>
					</tr>
					<tr>
						<td align="right">微信号:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" class="input-1" name="wx_sn" id="wx_sn" value="{$merch.wx_sn|escape}" />
						</td>
					</tr>
					<tr>
						<td align="right">描述:&nbsp;&nbsp;</td>
						<td align="left">
							<textarea name="description" rows="6" cols="105">{$merch.description}</textarea>
						</td>
					</tr>
					<tr>
						<td align="right">{$lang.if_show}：</td>
						<td align="left"><label><input type="radio" name="if_show" value="1" {if $merch.if_show == 1}checked="checked"{/if} />{$lang.yes}</label>&nbsp;&nbsp;&nbsp;&nbsp;<label><input type="radio" name="if_show" value="0" {if $merch.if_show == 0}checked="checked"{/if} />{$lang.no}</label></td>
					</tr>
	                 <tr>
		                <td colspan="2">
	                        <input type="submit" value="{$lang.submit}" id="submit" class="btn-2" />
	                        <input type="button" value="返回" class="btn-2" onclick="history.back();" />
		                </td>
	                </tr>
	            </tbody>
	         </table>
	    </form>
	</div>
 </div>
<div id="remsg"></div>
<script language="JavaScript" type="text/javascript" src="{res file=js/tab_color.js}"></script>
</body>
</html>